const fp = require('lodash/fp');
const { Maybe, Container } = require('../support');
let safeProp = fp.curry(function(x, o) {
    return Maybe.of(o[x]);
})

let user = {id: 2, name : 'Albert'};

let ex3 = () => {
    return safeProp('name', user).map(data => fp.first(data))._value;
}

// 或者
// let ex3 = () => {
//     return fp.first(safeProp('name', user)._value);
// }
console.log(ex3());